package com.zhouyu.service;

import com.zhouyu.spring.MyApplicationContext;

/**
 * @Description 测试类
 * @Author dangxianyue
 * @Date 2024/3/26 10:11
 */
public class Test {

    public static void main(String[] args) {
        final MyApplicationContext applicationContext = new MyApplicationContext(AppConfig.class);

        // System.out.println(applicationContext.getBean("userService"));
        // System.out.println(applicationContext.getBean("userService"));
        // System.out.println(applicationContext.getBean("orderService"));
        // System.out.println(applicationContext.getBean("orderService"));

        // UserService userService = (UserService) applicationContext.getBean("userService");

        // 由于用了JDK动态代理演示AOP功能，那么创建的bean就只是接口的实现类，这里只能用接口接收
        UserInterface userInterface = (UserInterface) applicationContext.getBean("userService");

        userInterface.test();

    }
}
